package net.wofly.right.validator;

import org.springframework.util.StringUtils;

public class UserManageValidator {
	
	/**
     * 换行符
     */
    private static String lineSeparator = System.getProperty("line.separator");
    
    public static String validateUserID(String userID) {
        StringBuffer stringBuffer = new StringBuffer();
        if (StringUtils.isEmpty(userID)) {
            stringBuffer.append("员工ID不能为空！").append(lineSeparator);
        }
        return stringBuffer.toString();
    }
    
    public static String validateUserIDAndMobile(String userID ,String mobile) {
        StringBuffer stringBuffer = new StringBuffer();
        if (StringUtils.isEmpty(userID)) {
            stringBuffer.append("员工ID不能为空！").append(lineSeparator);
        }
        if (StringUtils.isEmpty(mobile)) {
            stringBuffer.append("手机号不能为空！").append(lineSeparator);
        }
        return stringBuffer.toString();
    }
    
    public static String validateSaveUser(String userName, String mobile ,String organizationID ,String roleID) {
        StringBuffer stringBuffer = new StringBuffer();
        if (StringUtils.isEmpty(userName)) {
            stringBuffer.append("用户名称不能为空！").append(lineSeparator);
        }
        if (StringUtils.isEmpty(mobile)) {
            stringBuffer.append("手机号不能为空！").append(lineSeparator);
        }
        if (StringUtils.isEmpty(organizationID)) {
            stringBuffer.append("组织机构不能为空！").append(lineSeparator);
        }
        if (StringUtils.isEmpty(roleID)) {
            stringBuffer.append("用户角色不能为空！").append(lineSeparator);
        }
        
        return stringBuffer.toString();
    }
    
    public static String validateUpdateUser(String userID ,String userName, String mobile ,String organizationID ,String roleID) {
		StringBuffer stringBuffer = new StringBuffer();
		if (StringUtils.isEmpty(userID)) {
		    stringBuffer.append("员工ID不能为空！").append(lineSeparator);
		}
		validateSaveUser( userName, mobile , organizationID , roleID) ;
		
		return stringBuffer.toString();
		}
    
    public static String validateFindAllUser() {
        StringBuffer stringBuffer = new StringBuffer();
        return stringBuffer.toString();
    }

}
